<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
        name="viewport">
    <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
    <meta content="no-cache" http-equiv="pragma">
    <meta content="0" http-equiv="expires">
    <meta content="telephone=no, address=no" name="format-detection">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <title>跳蚤市场发布</title>
    <link href="{MODULE_URL}template/css/css.css" rel="stylesheet" />
    <link href="{MODULE_URL}template/css/stylesheet.css" rel="stylesheet" />
    <script type="text/javascript" src="{$_W['siteroot']}app/resource/js/lib/jquery-1.11.1.min.js"></script>
    <!--仿微社区上传图片-->
        <link rel="stylesheet" href="{MODULE_URL}template/imgupload/css/comm.css">
        <script type="text/javascript" src="{MODULE_URL}template/imgupload/js/global.js">
        </script>
        <script type="text/javascript" src="{MODULE_URL}template/imgupload/js/gps.js">
        </script>
        <script type="text/javascript" src="{MODULE_URL}template/imgupload/js/seajs-0.1.5.js">
        </script>
        <script type="text/javascript" src="{MODULE_URL}template/imgupload/js/newthread.js">
        </script>
        <script type="text/javascript" charset="utf-8" src="{MODULE_URL}template/imgupload/js/jpegmeta.js">
        </script>
        <script type="text/javascript" charset="utf-8" src="{MODULE_URL}template/imgupload/js/jpeg.encoder.basic.js">
        </script>
        <script type="text/javascript" charset="utf-8" src="{MODULE_URL}template/imgupload/js/image_compress.js">
        </script>
        
<!--仿微社区上传图片-->
<!--仿微社区上传图片-->
        <script type="text/javascript">
            var myurl="{php echo $this->createMobileUrl('imgupload')}";
        </script>
<!--仿微社区上传图片-->
<style type="text/css">
    
input[type=text], input[type=number] {
    -webkit-box-flex: 1;
    display: block;
    border: 0px;
    margin: 0px;
    padding: 0px 5px;
    font-size: 14px;
    height: 30px;
    text-align: left;
    box-sizing: border-box;
}
</style>
</head>
<body style="padding-bottom: 60px; padding-top: 20px;">
    <div class="sq_box form_box">
        <div class="text_title">
            跳蚤市场发布
        </div>
        <form action="" method="post"    enctype="multipart/form-data" onsubmit="return checkInfo(this);"  name="newthread" id="newthread" class="form-horizontal">
        <div class="form_text_div">
            <div class="form_name">标题：</div>
            <div class="form_input">
                <input id="title" name="title" type="text" placeholder="6-30字，不能写电话" maxlength="30" value="{$good['title']}"/>
            </div>
        </div>
         <div class="form_text_div">
            <div class="form_name">新旧：</div>
            <div class="form_input">
                <select id="rolex" name="rolex">
                   <option value='全新' {if $good['rolex'] == '全新'}selected{/if}>全新</option>
                        <option value='九成新' {if $good['rolex'] == '九成新'}selected{/if}>九成新</option>
                        <option value='八成新' {if $good['rolex'] == '八成新'}selected{/if}>八成新</option>
                        <option value='七成新' {if $good['rolex'] == '七成新'}selected{/if}>七成新</option>
                        <option value='六成新' {if $good['rolex'] == '六成新'}selected{/if}>六成新</option>
                        <option value='五成新' {if $good['rolex'] == '五成新'}selected{/if}>五成新</option>
                        <option value='四成新' {if $good['rolex'] == '四成新'}selected{/if}>四成新</option>
                </select>
            </div>
        </div>
         <div class="form_text_div">
            <div class="form_name">价格：</div>
            <div class="form_input">
                <input id="zprice" name="zprice" type="number"  value="{$good['zprice']}" placeholder="单位元" maxlength="5"/>
            </div>
        </div>
        <div class="form_text_div">
            <div class="form_name">姓名：</div>
            <div class="form_input">
                <input id="realname" name="realname" value="{$good['realname']}" type="text" placeholder="联系人姓名" maxlength="30" value=""/>
            </div>
        </div>
        <div class="form_text_div">
            <div class="form_name">电话：</div>
            <div class="form_input">
                <input id="mobile" name="mobile" value="{$good['mobile']}" type="text" placeholder="手机号码" maxlength="11" value=""/>
            </div>
        </div>
        <div class="form_text_div">
            <div class="form_name_onliny">商品描述：</div>
            <div class="form_hint">
                    最多可输入300字
            </div>
        </div>
        <div class="form_text_div">
            <div class="form_input">
                <textarea id="description" name="description" placeholder="商品描述" maxlength="300">{$good['description']}</textarea>
            </div>
        </div>
        <div class="form_text_div">
            <div class="form_name_onliny">上传图片：</div>
            <div class="form_hint">
                    最多上传9张图片
            </div>
        </div>
        <div class="form_img_box">
            <div class="tipLayer">
                <div class="photoList" style='margin-left:-40px;margin-top:-25px;'>
                    <ul>
                        <li class="on" id="addPic">
                            <input type="file" class="on needsclick" style="z-index:200;opacity:0;filter:alpha(opacity=0);-ms-filter:'alpha(opacity=0)';" id="uploadFile" accept="image/*" single>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="form_text_div">
            <div class="form_btn_box">
                <button type="submit" style="width:200px;height:35px;line-height:35px;background-color:#5bc0de;color:white;border:0;margin:4px 0 0 10px;font-size:18px;border-radius: 5px;">提交</button>
                <!-- <button type="submit" name="submit" value="yes" class="form_btn" >提交</button> -->
                <input type="hidden" name="token" value="{$_W['token']}" />
            </div>
        </div>
        </form>
    </div>
    <a href="" class="bottom_menu" style="display:none">←返回 </a>
    <script type="text/javascript">
        
        function checkInfo(form) {
        
        var mobile = form['mobile'].value;
        if (!mobile) {
            alert('请输入您的手机号码！');
            return false;
        }
        if (mobile.search(/^([0-9]{11})?$/) == -1) {
            alert('请输入正确的手机号码！');
            return false;
        }
        
        if (!form['title'].value) {
            alert('请输入宝贝标题。');
            return false;
        }
        if (!form['rolex'].value && form['rolex'].value==0) {
            alert('请选择成色。');
            return false;
        }
        if (!form['category'].value && form['pcate'].value==0) {
            alert('请选择分类。');
            return false;
        }
        if (!form['zprice'].value) {
            alert(' 请输入转让价格。');
            return false;
        }
        if (!form['realname'].value) {
            alert(' 请输入姓名。');
            return false;
        }
    }
    </script>
</body>
</html>
